using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableUnionFightFactoryDao:DaoBase<TableUnionFightFactory>
    {
        public override void AddPrimaryIndex(TableUnionFightFactory model)
        {
            cachePrimary[model.UFFId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableUnionFightFactory.txt";
        }

        protected override TableUnionFightFactory ParseRowData(string[] rowData)
        {
            TableUnionFightFactory data = new TableUnionFightFactory();

            if (string.IsNullOrEmpty(rowData[0]))
            {
                data.UFFId = 0;
            }
            else
            {
                data.UFFId = int.Parse(rowData[0]);
            }

            if (string.IsNullOrEmpty(rowData[1]))
            {
                data.UFId = 0;
            }
            else
            {
                data.UFId = int.Parse(rowData[1]);
            }
			data.Position = rowData [2];

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.Camp = 0;
            }
            else
            {
                data.Camp = int.Parse(rowData[3]);
            }

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.Range = 0;
            }
            else
            {
                data.Range = double.Parse(rowData[4]);
            }

            if (string.IsNullOrEmpty(rowData[5]))
            {
                data.IsField = 0;
            }
            else
            {
                data.IsField = int.Parse(rowData[5]);
            }
			data.NeedResource = rowData [6];

            if (string.IsNullOrEmpty(rowData[7]))
            {
                data.CraftTime = 0;
            }
            else
            {
                data.CraftTime = double.Parse(rowData[7]);
            }

            if (string.IsNullOrEmpty(rowData[8]))
            {
                data.RebuildTime = 0;
            }
            else
            {
                data.RebuildTime = double.Parse(rowData[8]);
            }

            if (string.IsNullOrEmpty(rowData[9]))
            {
                data.CariotId = 0;
            }
            else
            {
                data.CariotId = int.Parse(rowData[9]);
            }
			data.IconRes = rowData [10];

            if (string.IsNullOrEmpty(rowData[11]))
            {
                data.CariotAngle = 0;
            }
            else
            {
                data.CariotAngle = double.Parse(rowData[11]);
            }
			data.CariotBornPos = rowData [12];

            if (string.IsNullOrEmpty(rowData[13]))
            {
                data.CariotTargetGateId = 0;
            }
            else
            {
                data.CariotTargetGateId = int.Parse(rowData[13]);
            }
			data.CariotMoveNavInfo = rowData [14];
			data.UFGuardId = rowData [15];
			data.ModelUrl = rowData [16];
			data.NPCID = rowData [17];

            return data;
        }



    }

}
